Skip to content

Add wider chain support to did:pkh#27

Merged
venables merged 6 commits intomainfrom
venables/caip-schemas
Jul 26, 2025
Merged

Add wider chain support to did:pkh#27
venables merged 6 commits intomainfrom
venables/caip-schemas

Conversation

@venables
Copy link
Contributor

@venables venables commented Jul 24, 2025

The pkh-did-resolver package excluded many chains, including solana, which are necessary for an adequate did:pkh offering. This swaps out that package with an internal implementation which was trivial to create because we were already creating did:pkh documents internally.

Additionally, this adds schemas for CAIP-2, CAIP-10, CAIP-19 to the packages/did package. These will probably evolve to their own package eventually, but CAIP-2, CAIP-10 are used in the did:pkh implementation.

This also increases test coverage around did:pkh, and deprecated types like DidPkhChainId in favor of Caip2ChainId

venables added 3 commits July 24, 2025 18:49
The pkh-did-resolver package excluded many chains, including solana,
which are necessary for an adequate did:pkh offering.  This swaps out
that package with an internal implementation which was trivial to create
because we were already creating did:pkh documents locally
@venables venables changed the title Add CAIP schemas (CAIP-2, CAIP-10, CAIP-19) for use in did:pkh Add wider chain support to did:pkh Jul 25, 2025
Copy link
Collaborator

@domleboss97 domleboss97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments here and there but nothing blocking! really nice

zodv4
}

describe.each(Object.entries(schemas))("CAIP (%s)", (_name, schemas) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice, love it

} from "../methods/did-pkh"
import type { DIDResolutionResult, DIDResolver } from "did-resolver"

export async function resolve(did: string): Promise<DIDResolutionResult> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

love how small this is

@@ -1,4 +1,7 @@
export type DidUri = `did:${string}:${string}`
export type DidUri<
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sublime

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do the names have to be all this??

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, no they do not, but I had copied over from the did:pkh spec test suite where they had the same convention.

}

if (!isDidPkhChainId(`${chainNamespace}:${chainReference}`)) {
if (!isCaip2ChainId(`${chainNamespace}:${chainReference}`)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

putting this comment here cause it's the only commentable line - can we use caip10Parts utility in this function?

@venables venables merged commit 8ea5846 into main Jul 26, 2025
2 checks passed
@venables venables deleted the venables/caip-schemas branch July 26, 2025 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants